package edu.unc.comp410.colemangeer.demos;

import org.apache.log4j.Logger;
import org.omg.CORBA.portable.ApplicationException;

import edu.unc.comp410.colemangeer.data.IProductGateway;
import edu.unc.comp410.colemangeer.model.Catalog;
import edu.unc.comp410.colemangeer.model.CatalogBuilder;
import edu.unc.comp410.colemangeer.model.DataProvider;



public class CatalogDemo {
	
	private static Logger log = Logger.getLogger(ProductsDemo.class);
	private DataProvider dataProvider;
	private IProductGateway productsData;
	private CatalogBuilder catalogBuilder;

	public static void main(String[] args) {
		
		CatalogDemo demo = new CatalogDemo();
		demo.dataProvider = new DataProvider();
		try {
			demo.catalogBuilder = new CatalogBuilder(demo.dataProvider.getProductGateway());
		} catch (ApplicationException e) {
			log.error("data problem: could not get IProductGateway");
		}
		Catalog allCatalogItems = demo.catalogBuilder.getCatalog();
		
		log.info("Items in catalog...");
		allCatalogItems.logCatalog();
		
	}
}
